package pictureRater;

import java.util.Properties;

import android.util.Log;

public class properties {
	private boolean validCreds = false;
	private String accessKey = null;
	private String secretKey = null;
	private static properties instance = null;

	public static properties getInstance() {
		if (instance == null)
			instance = new properties();
		return instance;
	}

	public void properties() {
		try {
			Properties properties = new Properties();
			properties.load(this.getClass().getResourceAsStream(
					"awsCreds.properties"));

			this.accessKey = properties.getProperty("ACCESS_KEY_ID");
			this.secretKey = properties.getProperty("SECRET_KEY");

			if (this.accessKey == null || this.accessKey.equals("")
					|| this.accessKey.equals("CHANGEME")
					|| this.secretKey == null || this.secretKey.equals("")
					|| this.secretKey.equals("CHANGEME")) {
				this.validCreds = false;
			} else {
				this.validCreds = true;
			}
		} catch (Exception exception) {
			Log.e("properties", "Unable to read awsCreds.properties file.");
		}
	}

	public String getAccessKey() {
		return accessKey;
	}

	public String getSecretKey() {
		return secretKey;
	}
}
